home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
PROGRAMMING
/
DESKLIBC
/
SOURCES.ZIP
/
DeskLib
/
!DLSources
/
Libraries
/
Str
/
c
/
strncpycr
< prev
next >
Wrap
Text File
|
1995-07-08
|
1KB
|
33 lines
/*
#### # # # #
# # # # # The FreeWare C library for
# # ## ### # # # # ### RISC OS machines
# # # # # # # # # # # ___________________________________
# # #### ### ## # # # #
# # # # # # # # # # Please refer to the accompanying
#### ### #### # # ##### # ### documentation for conditions of use
________________________________________________________________________
File: Misc.strncpycr.c
Author: Copyright © 1994 Jason Howat
Version: 1.00 (18 Apr 1994)
Purpose: Copies a CR-terminated string - note that this will change the
terminator of the result to a NUL (0).
*/
#include "DeskLib:StringCR.h"
extern char *strncpycr(char *s1, char *s2, int n)
{
register char *end = s1 + n;
while ((*s2 > 31) && (s1 != end))
*(s1++) = *(s2++);
if(s1 != end) /* copy terminator if space */
*s1 = 0;
return(s1);
}